<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>TODO supply a title</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    </h:head>
    <h:body>
        <h:form id="form">
            <p:dataTable var="titulo" value="#{aprovaBean.lazyModel}" paginator="true" rows="10" 
                         paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}" 
                         rowsPerPageTemplate="5,10,15" selectionMode="single" selection="#{aprovaBean.selectedCar}" id="titTable" lazy="true">
                <p:ajax event="rowSelect" listener="#{aprovaBean.onRowSelect}" update=":form:titDetail" oncomplete="PF('titDialog').show()" />
                <p:column headerText="Prefixo">
                    <h:outputText value="#{titulo.e2Prefixo}" />
                </p:column>

                <p:column headerText="Numero" sortBy="#{titulo.e2Num}">
                    <h:outputText value="#{titulo.e2Num}" />
                </p:column>

                <p:column headerText="Parcela">
                    <h:outputText value="#{titulo.e2Parcela}" />
                </p:column>         
            </p:dataTable>


            <p:dialog header="Título" widgetVar="titDialog" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
                <p:outputPanel id="titDetail" style="text-align:center;">
                    <p:panelGrid columns="2" rendered="#{not empty aprovaBean.selectedCar}" columnClasses="label,value">

                        <h:outputText value="Prefixo" />
                        <h:outputText value="#{aprovaBean.selectedCar.e2Prefixo}" />

                        <h:outputText value="Numero" />
                        <h:outputText value="#{aprovaBean.selectedCar.e2Num}" />

                        <h:outputText value="Parcela" />
                        <h:outputText value="#{aprovaBean.selectedCar.e2Parcela}" />
                        
                        <h:outputText value="Tipo" />
                        <h:outputText value="#{aprovaBean.selectedCar.e2Tipo}" />
                        
                        <h:outputText value="Fornecedor" />
                        <h:outputText value="#{aprovaBean.selectedCar.e2Fornece} / #{aprovaBean.selectedCar.e2Loja}----#{aprovaBean.selectedCar.e2Nomfor}" />
                        
                        <h:outputText value="Parcela" />
                        <h:outputText value="#{aprovaBean.selectedCar.e2Parcela}" />
                        
                        <h:outputText value="Parcela" />
                        <h:outputText value="#{aprovaBean.selectedCar.e2Parcela}" />

                    </p:panelGrid>
                </p:outputPanel>
            </p:dialog>
        </h:form>
    </h:body>
</html>
